package com.ruoyi.statisticalCenter.service.impl;


import com.github.pagehelper.PageHelper;
import com.ruoyi.statisticalCenter.domain.ScAssetsAndLiabilities;
import com.ruoyi.statisticalCenter.domain.vo.ScAssetsAndLiabilitiesVo;
import com.ruoyi.statisticalCenter.mapper.ScAssetsAndLiabilitiesMapper;
import com.ruoyi.statisticalCenter.service.IScAssetsAndLiabilitiesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.core.text.Convert;

import java.util.List;

/**
 * 资产负债Service业务层处理
 *
 * @author ruoyi
 * @date 2024-03-16
 */
@Service
public class ScAssetsAndLiabilitiesServiceImpl implements IScAssetsAndLiabilitiesService
{
    @Autowired
    private ScAssetsAndLiabilitiesMapper scAssetsAndLiabilitiesMapper;

    /**
     * 查询资产负债
     *
     * @param id 资产负债主键
     * @return 资产负债
     */
    @Override
    public ScAssetsAndLiabilities selectScAssetsAndLiabilitiesById(Long id)
    {
        return scAssetsAndLiabilitiesMapper.selectScAssetsAndLiabilitiesById(id);
    }

    /**
     * 查询资产负债列表
     *
     * @param scAssetsAndLiabilities 资产负债
     * @return 资产负债
     */
    @Override
    public List<ScAssetsAndLiabilities> selectScAssetsAndLiabilitiesList(ScAssetsAndLiabilitiesVo scAssetsAndLiabilities)
    {
        //列表添加分页
        PageHelper.startPage(scAssetsAndLiabilities.getPageDate());
        return scAssetsAndLiabilitiesMapper.selectScAssetsAndLiabilitiesList(scAssetsAndLiabilities);
    }

    /**
     * 新增资产负债
     *
     * @param scAssetsAndLiabilities 资产负债
     * @return 结果
     */
    @Override
    public int insertScAssetsAndLiabilities(ScAssetsAndLiabilities scAssetsAndLiabilities)
    {
        return scAssetsAndLiabilitiesMapper.insertScAssetsAndLiabilities(scAssetsAndLiabilities);
    }

    /**
     * 修改资产负债
     *
     * @param scAssetsAndLiabilities 资产负债
     * @return 结果
     */
    @Override
    public int updateScAssetsAndLiabilities(ScAssetsAndLiabilities scAssetsAndLiabilities)
    {
        return scAssetsAndLiabilitiesMapper.updateScAssetsAndLiabilities(scAssetsAndLiabilities);
    }

    /**
     * 批量删除资产负债
     *
     * @param ids 需要删除的资产负债主键
     * @return 结果
     */
    @Override
    public int deleteScAssetsAndLiabilitiesByIds(String ids)
    {
        return scAssetsAndLiabilitiesMapper.deleteScAssetsAndLiabilitiesByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除资产负债信息
     *
     * @param id 资产负债主键
     * @return 结果
     */
    @Override
    public int deleteScAssetsAndLiabilitiesById(Long id)
    {
        return scAssetsAndLiabilitiesMapper.deleteScAssetsAndLiabilitiesById(id);
    }
}
